﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class ChucNang_Admin_Admin_ThongKeDoanhThuSanPhamTheoThang : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnThongKe_Click(object sender, EventArgs e)
    {
        DataDSTableAdapters.DATHANG_CHITIETDANGHANGTableAdapter adapter = new DataDSTableAdapters.DATHANG_CHITIETDANGHANGTableAdapter();
        DataDSTableAdapters.SANPHAMTableAdapter spadapter = new DataDSTableAdapters.SANPHAMTableAdapter();
        DataDS.SANPHAMDataTable sptable = new DataDS.SANPHAMDataTable();
        int id_sp=int.Parse(dropdownlistSanPham.SelectedValue.ToString());
        
        sptable=spadapter.SANPHAM_LayTheoIdSP(id_sp);
        imgSanPham.ImageUrl=sptable.Rows[0]["HinhAnh"].ToString();
        imgSanPham.DataBind();
        if (dropdownlistSanPham.SelectedValue != null )
        {

            GridView1.DataSource = adapter.DATHANG_CHITIETDATHANG_ThongKeDoanhThuSanPhamTheoNam(id_sp);
            GridView1.DataBind();
        }
       

    }
}
